package com.mpyy.handler.purchase;

import com.alibaba.fastjson.JSON;
import com.mpyy.pojo.ProductUnit;
import com.mpyy.service.purchase.SearchProductUnitServiceInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @version 1.0
 * @Descoription SearchProductUnitHandler
 * @Author CG
 * @date 2022-03-22
 */
@Controller
public class SearchProductUnitHandler {
    @Autowired
    @Qualifier(value = "searchProductUnitServiceImpl")
    private SearchProductUnitServiceInter productUnitServiceInter;

    @RequestMapping("/searchProductUnit")
    @ResponseBody
    public  String searchProductUnit(){
        List<ProductUnit> productUnits = productUnitServiceInter.searchProductUnit();
        return JSON.toJSONString(productUnits);
    }
}
